<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>WinXAddStatic</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->WinXAddStatic<!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>hStatic = WinXAddStatic (parent, STRING title, hImage, style, id) </p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>Adds a new static (label) control to the specified window.</p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->parent<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->&nbsp;The window to add this control to <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->STRING title<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->&nbsp;The text to appear in the control, or if this control displays an image, &quot;bitmap&quot; or &quot;icon&quot; depending on what kind of handle is specified by hImage <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->hImage<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->&nbsp;The handle to the image to display in this static control, or 0 if this static control does not display an image <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->style<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->&nbsp;The window style for the static control. See the remarks section <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->id<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The unique id of the static control <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>A handle to the static control or 0 on fail. </p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>The style parameter takes a standard window style. Listed are some of more usefull constants. See the Win32 documentation for a complete list. These constants can be combine with the | (or) operator.</p>
<dl>
  <dt>$$SS_BITMAP	</dt>
  <dd>This static control displays a bitmap image, the hImage parameter will be the handle to this bitmap and the title parameter will be &quot;bitmap&quot;</dd>
  <dt>$$SS_ICON</dt>
  <dd>This static control displays an icon, the hImage parameter will be the handle to this icon and the title parameter will be &quot;icon&quot;</dd>
  <dt>$$SS_LEFT</dt>
  <dd>The text is left justified in the control</dd>
  <dt>$$SS_CENTER</dt>
  <dd>The text is center justified in the control</dd>
  <dt>$$SS_RIGHT</dt>
  <dd>The text is right justified in the control  </dd>
</dl>
<p>The size and position of the static control is set using either a custom control sizer function (<a href="../Callbacks.htm/controlSizer.htm">controlSizer</a> callback) or the auto sizer. To use the auto sizer, use the <a href="../Auto%20Sizer.htm/WinXAutoSizer_SetInfo.htm">WinXAutoSizer_SetInfo</a> function. </p>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" --><span class="codeStyle">'define constants for the static controls <br>
$$IDSTATIC1 = 100 <br>
$$IDSTATIC2 = 101 <br>
<br>
'make a button with text <br>
hStatic1 = WinXAddStatic (#hMain, &quot;Click me&quot;, 0, $$SS_LEFT, $$IDSTATIC1)<br>
<br>
'make a button using an icon loaded from the resource file<br>
hImage = LoadIconA (GetModuleHandleA (0), &amp;&quot;mainIcon&quot;)<br>
hStatic2 = WinXAddStatic (#hMain, &quot;icon&quot;, hImage, $$SS_ICON, $$IDSTATIC2)</span><!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="../Auto%20Sizer.htm/WinXAutoSizer_SetInfo.htm">WinXAutoSizer_SetInfo</a><br>
<a href="../Callbacks.htm/controlSizer.htm">controlSizer (Callback)</a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
